package com.chenjun.core.dao.generator.mapper;

import com.chenjun.core.dao.generator.entity.OaBillLeaveApplication;
import com.chenjun.core.dao.generator.entity.OaBillLeaveApplicationExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OaBillLeaveApplicationMapper {
    @Delete({
        "delete from oa_bill_leave_application",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into oa_bill_leave_application (id, no, ",
        "status, bill_date, ",
        "note, year, month, ",
        "empl_id, empl_code, ",
        "empl_name, leave_begin_time, ",
        "leave_end_time, leave_type_id, ",
        "leave_type_name, processInstanceId)",
        "values (#{id,jdbcType=INTEGER}, #{no,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{billDate,jdbcType=TIMESTAMP}, ",
        "#{note,jdbcType=VARCHAR}, #{year,jdbcType=INTEGER}, #{month,jdbcType=INTEGER}, ",
        "#{emplId,jdbcType=VARCHAR}, #{emplCode,jdbcType=VARCHAR}, ",
        "#{emplName,jdbcType=VARCHAR}, #{leaveBeginTime,jdbcType=TIMESTAMP}, ",
        "#{leaveEndTime,jdbcType=TIMESTAMP}, #{leaveTypeId,jdbcType=INTEGER}, ",
        "#{leaveTypeName,jdbcType=VARCHAR}, #{processInstanceId,jdbcType=VARCHAR})"
    })
    int insert(OaBillLeaveApplication record);

    int insertSelective(OaBillLeaveApplication record);

    List<OaBillLeaveApplication> selectByExample(OaBillLeaveApplicationExample example);

    @Select({
        "select",
        "id, no, status, bill_date, note, year, month, empl_id, empl_code, empl_name, ",
        "leave_begin_time, leave_end_time, leave_type_id, leave_type_name, processInstanceId",
        "from oa_bill_leave_application",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    OaBillLeaveApplication selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OaBillLeaveApplication record);

    @Update({
        "update oa_bill_leave_application",
        "set no = #{no,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "bill_date = #{billDate,jdbcType=TIMESTAMP},",
          "note = #{note,jdbcType=VARCHAR},",
          "year = #{year,jdbcType=INTEGER},",
          "month = #{month,jdbcType=INTEGER},",
          "empl_id = #{emplId,jdbcType=VARCHAR},",
          "empl_code = #{emplCode,jdbcType=VARCHAR},",
          "empl_name = #{emplName,jdbcType=VARCHAR},",
          "leave_begin_time = #{leaveBeginTime,jdbcType=TIMESTAMP},",
          "leave_end_time = #{leaveEndTime,jdbcType=TIMESTAMP},",
          "leave_type_id = #{leaveTypeId,jdbcType=INTEGER},",
          "leave_type_name = #{leaveTypeName,jdbcType=VARCHAR},",
          "processInstanceId = #{processInstanceId,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OaBillLeaveApplication record);
}